package com.example.coursehub.repository;

import java.util.List;
import java.util.Optional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import com.example.coursehub.entity.FavoriteQuestionBankQuestion;
import com.example.coursehub.entity.FavoriteQuestionBankQuestionId;

public interface FavoriteQuestionBankQuestionRepository
        extends JpaRepository<FavoriteQuestionBankQuestion, FavoriteQuestionBankQuestionId>,
        JpaSpecificationExecutor<FavoriteQuestionBankQuestion> {
        
    List<FavoriteQuestionBankQuestion> findByFavoriteQuestionBank_FavoriteQuestionBankId(String favoriteQuestionBankId);
    
    Boolean existsByFavoriteQuestionBank_FavoriteQuestionBankIdAndQuestion_QuestionId(String favoriteQuestionBankId, String questionId);
    
    Optional<FavoriteQuestionBankQuestion> findByFavoriteQuestionBank_FavoriteQuestionBankIdAndQuestion_QuestionId(String favoriteQuestionBankId, String questionId);

    void deleteByQuestion_QuestionIdIn(List<String> questionIds);
}